package Model;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;
import java.util.TreeMap;

public class Customer {
    private String userID;
    private String name;
    private String addressStreet;
    private String addressCity;
    private String addressState;
    private String addressZip;
    private String phone;
    private Order order;
    
    public Customer() {
    	order = new Order();
    }
    
    public Customer(String userID, String name, String addressStreet, String addressCity, String addressState, String addressZip, String phone) {
    	this();
    	setUserID(userID);
        setName(name);
        setStreet(addressStreet);
        setCity(addressCity);
        setState(addressState);
        setZip(addressZip);
        setPhone(phone);
    }
    
    public Customer(ResultSet rs) throws SQLException {
    	this();
        userID = rs.getString("userID");
        name = rs.getString("name");
        addressStreet = rs.getString("addressStreet");
        addressCity = rs.getString("addressCity");
        addressState = rs.getString("addressState");
        addressZip = rs.getString("addressZip");
        phone = rs.getString("phone");
    }
    
    @Override
    public String toString() {
        return name + ", " + userID + "\nlives at " + addressStreet + "\n" + addressCity + ", " + addressState + " " + addressZip + "\n" + phone;
    }
    
    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getStreet() {
        return addressStreet;
    }
    
    public void setStreet(String street) {
        addressStreet = street;
    }
    
    public String getCity() {
        return addressCity;
    }
    
    public void setCity(String city) {
        addressCity = city;
    }
    
    public String getState() {
        return addressState;
    }
    
    public void setState(String state) {
        addressState = state;
    }
    
    public String getZip() {
        return addressZip;
    }
    
    public void setZip(String zip) {
        addressZip = zip;
    }
    
    public String getPhone() {
        return phone;
    }
    
    public void setPhone(String phone) {
        this.phone = phone;
    }
    
    public void setOrder(Order ord) {
    	order = ord;
    }
    
    public Order getOrder() {
    	return order;
    }
    
    public void resetOrder() {
    	order = new Order();
    }
    
    

}